﻿@model WebApplication.Models.ServerModel
@{
    ViewBag.Title = "Add";
}

<script src="../../Scripts/jquery-1.7.1.js"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="../../Content/Site.css" rel="stylesheet" />
<script src="../../Scripts/jquery-ui-1.8.20.js"></script>
<script src="../../Scripts/My/addServerApplications.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">


@using (Html.BeginForm("Add", "Server", FormMethod.Post))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Добавление нового сервера в систему</legend>


        @if (ViewData["errors"] != null)
        {
            <div class="alert alert-error">
                <p>@ViewData["errors"]</p>
            </div>
        }

        <div style="float: left;">
            <div class="editor-label">
                @Html.LabelFor(model => model.Name)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Name)
                @Html.ValidationMessageFor(model => model.Name)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.RemoteHostName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.RemoteHostName)
                @Html.ValidationMessageFor(model => model.RemoteHostName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.RemoteHostPort)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.RemoteHostPort)
                @Html.ValidationMessageFor(model => model.RemoteHostPort)
            </div>

             <div class="editor-label">
                @Html.LabelFor(model => model.Login)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Login)
                @Html.ValidationMessageFor(model => model.Login)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Password)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Password)
                @Html.ValidationMessageFor(model => model.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Description)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.Description)
                @Html.ValidationMessageFor(model => model.Description)
            </div>
            <div class="editor-label">
                <p>Тип сервера</p>
            </div>
            <div>
                @Html.DropDownList("ServerType")
            </div>
        </div>

        <div class="app-list">
            <div>
                <input type="button" id="AddServerObject" value="Добавить приложение" class="btn btn-link" />
            </div>
            <div>

                <div class="app-wrap">

                    @*<div class="well">
                        <div>
                            <div id="appName" numapp="0" class="pull-left">eyu</div>
                            <div class="btn-group pull-left margin-left-20">
                              <div class="pull-left">
                                  <input type="button" class="btn btn-link" id="editApp" value="Редактировать" />
                              </div>
                               <div class="pull-left">
                                  <input type="button" class="btn btn-link" id="deleteApp" value="Удалить" />
                              </div>
                            </div>
                        </div>
                        <div id="appInfoHide" class="hide">
                            <input type="text" name="ServerObjects[0].Name" value="eyu"><input type="text" name="ServerObjects[0].Name" value="tyu"><input type="text" name="ServerObjects[0].Name" value="rtuy"><input type="text" name="ServerObjects[0].Name" value="yu"><input type="text" name="ServerObjects[0].Name" value="rtuy"><input type="text" name="ServerObjects[0].Name" value="uy"><input type="text" name="ServerObjects[0].Name" value="ruy"><input type="text" name="ServerObjects[0].Name" value="456"></div>
                    </div>*@
                </div>


            </div>
        </div>



    </fieldset>
    <div>
        <input type="submit" class="btn btn-small" value="Добавить" data-toggle="modal  " />
    </div>
    <div id="modalNotifications">

    </div>
    <div style="display: none;" idnumapp="" class="modal" id="addServerObjectModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Добавить приложение</h3>
        </div>
        <div class="modal-body" id="appContent">
            <p>Параметры приложения</p>
            <div class="well">
                <div>
                    <p>Имя приложения</p>
                    <input type="text" name="Name" />
                </div>
                <div>
                    <p>Кастомизация</p>
                    <textarea class="text-area" name="CustomizationXml"></textarea>
                </div>
                <div>
                    <p>Параметры компиляции</p>
                    <input type="text" name="BuildParameters" />
                </div>
                <div>
                    <p>Параметры развертывания</p>
                    <input type="text" name="DeployParameters" />
                </div>

            </div>
            <p>Параметры репозитория</p>
            <div class="well">
                <div>
                    <p>Адрес</p>
                    <input type="text" name="SrcUrl" />
                </div>
                <div>
                    <p>Имя пользователя</p>
                    <input type="text" name="SvnUserName" />
                </div>
                <div>
                    <p>Пароль</p>
                    <input type="password" name="SvnUserPassword" />
                </div>
                <div>
                    <p>Номер ревизии</p>
                    <input type="text" name="SvnRevesion" />
                </div>

            </div>
            <div class="well">
                <div>
                    <p  id="btnNotifications" class="btn btn-primary">Выбрать пользователей</p>
                </div>
                <div id="NotificationsUsers">

                </div>
            </div>
        </div>
        <div class="modal-footer">
            <p class="btn btn-primary" id="AddBtn">Добавить</p>
            <p class="btn" data-dismiss="modal" aria-hidden="true" id="CloseBtn">Закрыть</p>
        </div>
    </div>

}
